package cn.kgc.cloud.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 课工场
 * @date 2024/1/9
 * @description
 */
@RestController
@RequestMapping("config")
@RefreshScope
public class NacosConfigController {

    @Value("${server.port}")
    private Integer port;

    @Value("${name}")
    private String name;

    @Value("${age}")
    private Integer age;

    @GetMapping
    public String method1(){
        return "invoke NacosConfigController ok port =  "+port+" name:"+name+" age:"+age;
    }

}
